package com.gton.handler.enumpackage;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonValue;

/**
 * @description: Mybatis-plus :通用枚举
 * @author: GuoTong
 * @createTime: 2021-10-21 16:01
 * @since JDK 1.8 OR 11
 **/
public enum GlobalStateEnum {


    HAVE_USE(0, "无效"),
    NO_USE(1, "有效");

    //数据库存入的字段：0标识无效 ，1有效
    @EnumValue
    @JsonValue    //标记响应json值
    private Integer state;

    private String chinaMsg;

    GlobalStateEnum(int state, String chinaMsg) {
        this.state = state;
        this.chinaMsg = chinaMsg;
    }

    GlobalStateEnum(String chinaMsg, int state) {
        this.state = state;
        this.chinaMsg = chinaMsg;
    }

    @Override
    public String toString() {
        return "GenderTypeEnum{" +
                "state=" + state +
                ", chinaMsg='" + chinaMsg + '\'' +
                '}';
    }
}
